/*
 * File:   Reader.h
 * Author: Elevator
 *
 * Created on July 24, 2013, 8:40 PM
 */

#ifndef DATA_SERIALIZATION_H
#define DATA_SERIALIZATION_H

#include "json/json.h"

#include "Objects/CommandType.h"
#include "Objects/Command.h"
#include "Objects/Action.h"
#include "Objects/Rule.h"

#include "Objects/Model.h"

#include "Objects/DetailDef.h"
#include "Objects/Detail.h"
#include "Objects/RotorDef.h"
#include "Objects/Rotor.h"

#include "Objects/Link.h"

#include "Objects/CreatureDef.h"
#include "Objects/Creature.h"

#include "Objects/PlayerType.h"
#include "Objects/Player.h"

#include "Objects/Shape.h"
#include "Objects/Obstacle.h"
#include "Objects/Map.h"

#include "Objects/Camera.h"

#include "Objects/Scene.h"


namespace data {

	Scene* DeserializeScene( const Json::Value& value );
	Json::Value SerializeScene( const Scene* scene );

	Camera* DeserializeCamera( const Json::Value& value );
	Json::Value SerializeCamera( const Camera* camera );

	Map* DeserializeMap( const Json::Value& value );
	Json::Value SerializeMap( const Map* map );

	Obstacle* DeserializeObstacle( const Json::Value& value );
	Json::Value SerializeObstacle( const Obstacle* obstacle );

	Shape* DeserializeShape( const Json::Value& value );
	Json::Value SerializeShape( const Shape* shape );

	Player DeserializePlayer( const Json::Value& value );
	Json::Value SerializePlayer( const Player& player );

	PlayerType DeserializePlayerType( const Json::Value & value );
	Json::Value SerializePlayerType( const PlayerType& value );

	Creature* DeserializeCreature( const Json::Value & value );
	Json::Value SerializeCreature( const Creature* creature );

	CreatureDef* DeserializeCreatureDef( const Json::Value & value );
	Json::Value SerializeCreatureDef( const CreatureDef* creatureDef );

	Detail* DeserializeDetail( const Json::Value & value );
	Json::Value SerializeDetail( const Detail* detail );

	DetailDef* DeserializeDetailDef( const Json::Value & value );
	Json::Value SerializeDetailDef( const DetailDef* detailDef );

	Texture DeserializeTexture( const Json::Value & value );
	Json::Value SerializeTexture( const Texture& texture );

	Model* DeserializeModel( const Json::Value & value );
	Json::Value SerializeModel( const Model* model );

	Rotor* DeserializeRotor( const Json::Value & value );
	Json::Value SerializeRotor( const Rotor* rotor );

	RotorDef* DeserializeRotorDef( const Json::Value & value );
	Json::Value SerializeRotorDef( const RotorDef* rotorDef );

	Link DeserializeLink( const Json::Value & value );
	Json::Value SerializeLink( const Link& link );

	Rule DeserializeRule( const Json::Value & value );
	Json::Value SerializeRule( const Rule& rule );

	Command DeserializeCommand( const Json::Value & value );
	Json::Value SerializeCommand( const Command& command );

	CommandType DeserializeCommandType( const Json::Value & value );
	Json::Value SerializeCommandType( const CommandType& commandType );

	Action DeserializeAction( const Json::Value & value );
	Json::Value SerializeAction( const Action & action );

	Circle DeserializeCircle( const Json::Value & value );
	Json::Value SerializeCircle( const Circle & circle );

	Transform DeserializeTransform( const Json::Value & value );
	Json::Value SerializeTransform( const Transform & transform );

	Vec2 DeserializeVec2( const Json::Value & value );
	Json::Value SerializeVec2( const Vec2 & vec2 );
}
#endif	/* DATA_SERIALIZATION_H */

